package com.baizhi.app.controller;

import com.baizhi.app.common.R;
import com.baizhi.dao.AlbumDao;
import com.baizhi.entity.CmfzAlbum;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.Query;
import java.util.List;

@RestController
@RequestMapping("app/album")
public class AppAlbumController {
    @Autowired
    private AlbumDao ad;

    @GetMapping("sixAlbum")
    public R sixAlbum(){
        QueryWrapper<CmfzAlbum> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("album_star");
        Page<CmfzAlbum> page=new Page<>(1,6);
        Page<CmfzAlbum> cmfzAlbumPage = ad.selectPage(page, wrapper);

        return R.ok().put("data",cmfzAlbumPage);
    }



}
